<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <script src="../js/scripts/jquery.min.js" type="text/javascript"></script>
    <script src="../js/tz_cfg.js?version=2.0.6" type="text/javascript"></script>
    <script type="text/javascript">
        tz.cfg.base = "/sso"
    </script>
    <script src="../js/scripts/boot.js" type="text/javascript"></script>
    <!-- 引入MiniUI的样式 -->
    <link href="../plugin/miniui/default/medium-mode.css" rel="stylesheet" type="text/css" />

    <link href="../js/scripts/miniui/themes/default/miniui.css" rel="stylesheet" type="text/css" />
    <link href="../css/common_ext.css" rel="stylesheet" type="text/css" />
    <link href="../css/common.css" rel="stylesheet" type="text/css" />

    <link href="../css/mgr/baseStyle.css" rel="stylesheet" type="text/css" />
    <link href="../css/color.css" rel="stylesheet" type="text/css" />
    <link href="../css/skin.css" rel="stylesheet" type="text/css" />
    <link href="../css/tz-skin.css" rel="stylesheet" type="text/css" />

</head>

<body>
    <!-- 使用 mini表格 需要加上 mini-layout类-->
    <div class="mini-layout mainCon">
        <div region="west" showHeader="false" style="border:0px" showSplitIcon="false" width="360px">
            <div class="mini-fit line">
                <div class="mini-toolbar" borderStyle="border:0">
                    <div class="toolbarTit" style="margin-top: 0">机构管理</div>
                    <div class="btnCon">
                        <input id="searchOrgKey" class="mini-textbox" onenter="searchOrgByKey()" width="170" emptytext="请输入机构名称">
                        <a class="mini-button blueBtn" onclick="searchOrgByKey()" tooltip="查询">查询</a>
                        <a class="mini-button reload blueBtn" onclick="resetSearchOrgByKey()" tooltip="重置">重置</a>
                    </div>
                    <div class="btnCon" style="margin: 5px 0">
                        <a class="mini-button reload icon" iconCls="fa fa-plus" title="新增下级机构" onclick="onAddNode()" style="margin-right: 15px">新增下级机构</a>
                        <a class="mini-button reload icon" iconCls="fa fa-remove" tooltip="删除机构" onclick="deleteOrg()">删除机构</a>
                    </div>
                </div>
                <div class="mini-fit" style="width: 95%;">
                    <ul id="tree" class="mini-tree" url="${request.contextPath}/sys/org/queryManagerLazyTree" style="width:100%; height: 100%; padding:5px;" ajaxOptions="{async:true}" showTreeIcon="true" resultAsTree="false" textField="orgName" idField="bsc001" parentField="bsc110"
                        onnodeclick="onTreeNodeClick" onbeforeload="onBeforeTreeLoad" onpreload="onPreLoadTree">
                    </ul>
                </div>
            </div>
        </div>
        <div region="center" width="auto" style="border:0px">
            <div class="mini-toolbar" borderStyle="border:0" style=" padding-top:11px;">
                <div class="toolbarTit" style="margin-top: 0">基本信息</div>
                <table id="searchUserForm" style="width:100%;">
                    <tr style="width: 100%">
                        <td style="white-space:nowrap;" class="mini-col-4">
                            <input class="mini-textbox" labelField="true" label="机构全称" labelStyle="width:80px" id="searchUserKey" name="searchUserKey" width="95%" maxLength="50" onenter="searchUser()" emptyText="" required="true"/>
                        </td>
                      
                        <td class="mini-col-4">
                            <input class="mini-textbox" id="bsc071" name="bsc071" maxLength="11" labelField="true" label="机构简称" labelStyle="width:80px" width="95%" onenter="searchUser()" emptyText=""  required="true"/>
                        </td>
                    </tr>
                    <tr>
                        <td class="mini-col-4">
                            <input class="mini-combobox" id="certRealName" name="certRealName" labelStyle="width:80px" labelField="true" label="机构地址" width="95%" showNullItem="true" allowInput="false" textField="text" valueField="id"  />
                        </td>
                        <td class="mini-col-4">
                            <input class="mini-combobox" name="status" id="status" labelStyle="width:80px" labelField="true" label="机构类型" width="95%" showNullItem="true" allowInput="false" textField="text" valueField="id" data="[{'id':'normal','text':'行政机构'},{'id':'locked','text':'已锁定'}]" required="true"
                            />
                        </td>
                    </tr>
                    <tr>
                        <td class="mini-col-4">
                            <input class="mini-combobox" id="certRealName" name="certRealName" labelStyle="width:80px" labelField="true" label="上级机构" width="95%" showNullItem="true" allowInput="false" textField="text"  required="true"/>
                        </td>
                        <td class="mini-col-4">
                            <input class="mini-combobox" name="status" id="status" labelStyle="width:80px" labelField="true" label="行政区划" width="95%" showNullItem="true" allowInput="false" textField="text" valueField="id" data="" required="true"
                            />
                        </td>
                    </tr>
                    <tr>
                        <td class="mini-col-4">
                            <input class="mini-combobox" id="certRealName" name="certRealName" labelStyle="width:80px" labelField="true" label="联系人" width="95%" showNullItem="true" allowInput="false" textField="text" valueField="id"  />
                        </td>
                        <td class="mini-col-4">
                            <input class="mini-combobox" name="status" id="status" labelStyle="width:80px" labelField="true" label="联系电话" width="95%" showNullItem="true" allowInput="false" textField="text" valueField="id" data=""
                            />
                        </td>
                    </tr>

                    <tr>
                        <td class="mini-col-4">
                            <input class="mini-datepicker" name="bsc052" labelfield="true" label="建立时间" maxLength="2" width="90%" required="true" >
                        </td>
                        <td class="mini-col-4">
                            <input class="mini-combobox" name="status" id="status" labelStyle="width:80px" labelField="true" label="是否有效" width="95%" showNullItem="true" allowInput="false" textField="text" valueField="id" data="[{'id':'0','text':'是'},{'id':'1','text':'否'}]" required="true"
                            />
                        </td>
                    </tr>
                    <tr>
                        <td class="mini-col-4">
                            <input class="mini-combobox" id="certRealName" name="certRealName" labelStyle="width:80px" labelField="true" label="邮政编码" width="95%" showNullItem="true" allowInput="false" textField="text" valueField="id"  />
                        </td>
                      
                    </tr>
                    <tr>
                        <td class="mini-col-4">
                            <input class="mini-combobox" id="certRealName" name="certRealName" labelStyle="width:80px" labelField="true" label="备注" width="100%" showNullItem="true" allowInput="false" textField="text" valueField="id"  />
                        </td>
                      
                    </tr>



                    <tr>
                        <td>
                            <a class="mini-button blueBtn" onclick="searchUser()">查询</a>
                            <a class="mini-button reload blueBtn" onclick="resetSearchUser()">重置</a>
                        </td>
                    </tr>
                </table>
            </div>
        </div>
    </div>
</body>


<script type="text/javascript">
    mini.parse();
    var grid = tz.get('grid');
    var tree = tz.get("tree");
    // 整个培训表单
    var searchPeixunForm = tz.form("#searchPeixunForm");

    //重置按钮
    function resetSearchOrgByKey(e) {
        tz.get("searchClassKey").setValue("");
        tz.get("searchClassName").setValue("");
    }

    //按照搜索条件 搜索班级
    function searchOrgByKey() {
        var searchClassKey = tz.get("searchClassKey").getValue();
        var searchClassName = tz.get("searchClassName").getValue();

        if (searchOrgKey) {
            tree.load(tz.url("/sys/org/queryManagerTreeByName", {
                searchOrgKey: searchOrgKey
            }));
        } else {
            tree.load(tz.url("/sys/org/queryManagerLazyTree"));
        }
    }
</script>

</html>